﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;


namespace WGCSFramework.images
{
    public class WgResizer
    {
        /// <summary>
        /// Resize bitmap
        /// </summary>
        /// <param name="image">Input image</param>
        /// <param name="newWidth">New width of image</param>
        /// <param name="newHeight">New height of image</param>
        /// <returns>Resized image</returns>
        public static Bitmap ResizeBitmap(Image image, int newWidth, int newHeight)
        {
            Bitmap result = new Bitmap(newWidth, newHeight);
            using (Graphics g = Graphics.FromImage((Image) result))
            {
                g.DrawImage(image, 0, 0, newWidth, newHeight);
            }
            return result;
        }

    }
}
